'use strict'
// Template version: 1.0.0
// see http://vuejs-templates.github.io/webpack for documentation.

const path = require('path')

function resolve(dir) {
  return path.join(__dirname, '..', dir)
}

module.exports = {
  // 商家门面图尺寸
  common: {
    spWidth: 340,
    spHeight: 250
  },
  mand: {
    theme: {
      path: resolve('h5/styles/theme.styl')
    },
    pxtorem: {
      // If you modify rootValue, you also need to modify rem in static/responsive.js
      rootValue: 100, // 1rem=100px
      propWhiteList: []
    }
  },
  // 开发
  dev: {
    viewAction: 'https://upload.emeker.com',
    uploadAction: 'https://upload.emeker.com/upload',
    // 平台店 用户id
    userid: '9650ae343f19413f8626ff961476fa38xx',
    spid: '08f477377c51469a94a1e6e8b70b2112xx',
    token: '766ee2e2414a040a23b384527b12dee164114ac35919aa5fd5d796c04e8b32e2d0afe7b579c49975911c3bb6ad06aace:90b32eaab9f74de9ec871bbe996fdb63',
    // Paths
    assetsSubDirectory: 'static',
    assetsPublicPath: '/',
    staticPath: '/static',

    // Various Dev Server settings
    // host: 'localhost'
    host: '0.0.0.0', // can be overwritten by process.env.HOST
    port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
    autoOpenBrowser: true,
    errorOverlay: true,
    notifyOnErrors: true,
    poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
    // Use Eslint Loader?
    // If true, your code will be linted during bundling and
    // linting errors and warnings will be shown in the console.
    useEslint: false,
    // If true, eslint errors and warnings will also be shown in the error overlay
    // in the browser.
    showEslintErrorsInOverlay: false,
    /**
     * Source Maps
     */
    // https://webpack.js.org/configuration/devtool/#development
    devtool: 'cheap-module-eval-source-map',
    // If you have problems debugging vue-files in devtools,
    // set this to false - it *may* help
    // https://vue-loader.vuejs.org/en/options.html#cachebusting
    cacheBusting: true,
    cssSourceMap: true,
    proxyTable: {
      '/api': {
        target: 'http://127.0.0.1:3100',
        changeOrigin: true,
        pathRewrite: {
          '^/api': '/wb'
        }
      }
    },
    pl: 'http://localhost:3000'
  },
  // 测试
  test: {
    viewAction: 'https://upload.emeker.com',
    uploadAction: 'https://upload.emeker.com/upload',
    token: '8fd185e927258830f9ed828d1bada179c8aeaeed159ccc1c906cc20667a44728d0afe7b579c49975911c3bb6ad06aace:3c9b6ad38729e04071de1377d5214589',
    // 平台店 用户id
    userid: '444f8cef97cb43e89f2280832f32b51a',
    spid: '9db3ca21d7624452ae9bdc7dbf2c7f4b',
    // Paths
    assetsRoot: path.resolve(__dirname, '../dist'),
    assetsSubDirectory: 'static',
    assetsPublicPath: '/',
    staticPath: '/static',
    // Source Maps
    productionSourceMap: true,
    // https://webpack.js.org/configuration/devtool/#production
    devtool: '#source-map',

    // Gzip off by default as many popular static hosts such as
    // Surge or Netlify already gzip all static assets for you.
    // Before setting to `true`, make sure to:
    // npm install --save-dev compression-webpack-plugin
    productionGzip: false,
    productionGzipExtensions: ['js', 'css'],

    // Run the build command with an extra argument to
    // View the bundle analyzer report after build finishes:
    // `npm run build --report`
    // Set to `true` or `false` to always turn it on or off
    bundleAnalyzerReport: process.env.npm_config_report,
    pl: 'https://dmitest.emelife.cn'
  },
  // 生产
  build: {
    viewAction: 'https://upload.emeker.com',
    uploadAction: 'https://upload.emeker.com/upload',
    token: '23283155e810ff46e9a87c40de170a77e4c2e021b8b9328a89a8e9c4c94d2450d0afe7b579c49975911c3bb6ad06aace:b45032b1ff0db6c30f4c553c6ba4e081',
    // 平台店 用户id
    userid: '6b7c67310b0a47a7a85aa7945495ae90',
    spid: 'f04253234ea746c3ad77d5f2ee2390d4',
    // Paths
    assetsRoot: path.resolve(__dirname, '../dist'),
    assetsSubDirectory: 'static',
    assetsPublicPath: '/',
    staticPath: '/static',
    /**
     * Source Maps
     */
    productionSourceMap: true,
    // https://webpack.js.org/configuration/devtool/#production
    devtool: '#source-map',

    // Gzip off by default as many popular static hosts such as
    // Surge or Netlify already gzip all static assets for you.
    // Before setting to `true`, make sure to:
    // npm install --save-dev compression-webpack-plugin
    productionGzip: false,
    productionGzipExtensions: ['js', 'css'],

    // Run the build command with an extra argument to
    // View the bundle analyzer report after build finishes:
    // `npm run build --report`
    // Set to `true` or `false` to always turn it on or off
    bundleAnalyzerReport: process.env.npm_config_report,
    pl: 'https://dmi.meidp.cn'
  },
  // 外包
  lib: {
    // Paths
    assetsRoot: path.resolve(__dirname, '../lib'),
    assetsSubDirectory: 'static',
    assetsPublicPath: '/',
    /**
     * Source Maps
     */
    productionSourceMap: false,
    // https://webpack.js.org/configuration/devtool/#production
    devtool: '#source-map',

    // Gzip off by default as many popular static hosts such as
    // Surge or Netlify already gzip all static assets for you.
    // Before setting to `true`, make sure to:
    // npm install --save-dev compression-webpack-plugin
    productionGzip: false,
    productionGzipExtensions: ['js', 'css'],

    // Run the build command with an extra argument to
    // View the bundle analyzer report after build finishes:
    // `npm run build --report`
    // Set to `true` or `false` to always turn it on or off
    bundleAnalyzerReport: process.env.npm_config_report
  }
}